//
//  CommonCofnig.h
//  SubscribeBase
//
//  Created by changshuai on 2018/7/13.
//  Copyright © 2018年 changshuai. All rights reserved.
//

#ifndef CommonCofnig_h
#define CommonCofnig_h

#define CC_VSTATE_URL @"http://18.144.16.113/test/checkNewTheme"

#define CC_FACEBOOK_HOME_URL @"https://www.facebook.com/IHoroscope-490075541451740/"
//#define kQCFacebookAppKey @"bd3c3a01d30c234bf84bb7e6fa81fd89"
#define kCCFBDisplayName @"iHoroscope"

#define CC_SCREEN_HEIGHT           [[UIScreen mainScreen] bounds].size.height
#define CC_SCREEN_WIDTH            [[UIScreen mainScreen] bounds].size.width
#define CC_SCALE_WIDTH_6(__length)   round( CC_SCREEN_WIDTH / 370.0 * __length )
#define CC_SCALE_HEIGHT_6(__length)  round( CC_SCREEN_HEIGHT / 667.0 * __length )
#define CC_UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define weakify(var) __weak typeof(var) AHKWeak_##var = var;
#define strongify(var) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
__strong typeof(var) var = AHKWeak_##var; \
_Pragma("clang diagnostic pop")

#define CC_IsValidArray(_ARRAY___) (_ARRAY___ && [_ARRAY___ isKindOfClass:[NSArray class]] && [_ARRAY___ count])
#define CC_IsValidDictionary(_DICTIONARY___) (_DICTIONARY___ && [_DICTIONARY___ isKindOfClass:[NSDictionary class]] && [_DICTIONARY___ count])
#define CC_IsValidNSString(_STRING___) (_STRING___ && [_STRING___ isKindOfClass:[NSString class]] && [_STRING___ length])
#define CC_IsValidNSNumber(_NUMBER___) (_NUMBER___ && [_NUMBER___ isKindOfClass:[NSNumber class]] )
#define CC_IsNullObj(____object____) ((____object____ && [____object____ isKindOfClass: [NSNull class]]) || (____object____ == nil))

#endif /* CommonCofnig_h */
